import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import { Button } from 'antd';
import PageHeaderLayout from '../../layouts/PageHeaderLayout';
import ListTable from "./Components/ListTable";
import HistoryListTable from "./Components/HistoryListTable";


@connect()

export default class PathList extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      detailId: 0,
      detailInfoId: 0,
    };
  }

  componentWillUnmount(){
    const { dispatch } = this.props;
    dispatch({
      type: `reapair/appendClearState`,
    })
  }


  render() {
    const { location } = this.props;
    const pagesquery = location.query;

    return (

          <PageHeaderLayout >
            {
              location.pathname=="/fault/history/list" &&
              <HistoryListTable
                pagesquery={pagesquery}
              />
            }
            {
              location.pathname=="/fault/current/list" &&
              <ListTable
                pagesquery={pagesquery}
              />
            }
          </PageHeaderLayout>


    );
  }
}
